//
//  PaySuccessDispatchTableViewCell.m
//  shanHaiHuiApp
//
//  Created by DS on 2018/8/28.
//  Copyright © 2018年 徐双. All rights reserved.
//

#import "PaySuccessDispatchTableViewCell.h"

@implementation PaySuccessDispatchTypeTableViewCell

- (instancetype)initWithCellIdentifier:(NSString *)cellID{
    
    if (self = [super initWithCellIdentifier:cellID]) {
        
        _dispatchTypeLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _lineView = [UIView addLineViewColor:getColor(dividerColor)];
        
        [self sd_addSubviews:@[self.dispatchTypeLabel,self.lineView]];
        
        [self layOutFrame];
    }
    
    return self;
}

- (void)layOutFrame{
    
    ws(self)
    
    [self.dispatchTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.centerY.mas_equalTo(weakself.mas_centerY);
  
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
        
    }];
}


@end


@implementation PaySuccessDispatchAdressTableViewCell

- (instancetype)initWithCellIdentifier:(NSString *)cellID{
    
    if (self = [super initWithCellIdentifier:cellID]) {
        
        _goodLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _nameLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _phoneLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _adressLabel = [UILabel addLableFont:11 WithColor:getColor(@"8D8D8D")];
        _adressLabel.numberOfLines = 0;
        
        _lineView = [UIView addLineViewColor:getColor(dividerColor)];
        
        [self sd_addSubviews:@[self.goodLabel,self.lineView,self.nameLabel,self.phoneLabel,self.adressLabel]];
        
        [self layOutFrame];
    }
    
    return self;
}

- (void)layOutFrame{
    
    ws(self)
    
    [self.goodLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.top.mas_equalTo(UNIT_HEIGHT(15));
        make.width.mas_equalTo(UNIT_WIDTH(80));
        
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakself.goodLabel.mas_right).offset(UNIT_WIDTH(10));
        make.centerY.mas_equalTo(weakself.goodLabel.mas_centerY);
        
    }];
    
    [self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(UNIT_WIDTH(-15));
        make.centerY.mas_equalTo(weakself.goodLabel.mas_centerY);
    }];
    
    [self.adressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.nameLabel.mas_bottom).offset(UNIT_HEIGHT(10));
        make.leading.mas_equalTo(weakself.nameLabel.mas_leading);
        make.trailing.mas_equalTo(weakself.phoneLabel.mas_trailing);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
        
    }];
}


@end

@implementation PaySuccessDispatchRemarkTableViewCell

- (instancetype)initWithCellIdentifier:(NSString *)cellID{
    
    if (self = [super initWithCellIdentifier:cellID]) {
        
        _remarkLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _remarkContentLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _lineView = [UIView addLineViewColor:getColor(dividerColor)];
        
        [self sd_addSubviews:@[self.remarkLabel,self.lineView,self.remarkContentLabel]];
        
        [self layOutFrame];
    }
    
    return self;
}

- (void)layOutFrame{
    
    ws(self)
    
    [self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(UNIT_WIDTH(15));
        //make.centerY.mas_equalTo(weakself.mas_centerY);
        make.top.mas_equalTo(UNIT_HEIGHT(15));
        
        make.width.mas_equalTo(UNIT_WIDTH(80));
        
    }];
    
    
    [self.remarkContentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(UNIT_HEIGHT(15));
        make.left.mas_equalTo(weakself.remarkLabel.mas_right).offset(UNIT_WIDTH(0));
        make.right.mas_equalTo(UNIT_WIDTH(-15));
    }];
    
    
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
        
    }];
}


@end


@implementation PaySuccessDispatchPersonTableViewCell

- (instancetype)initWithCellIdentifier:(NSString *)cellID{
    
    if (self = [super initWithCellIdentifier:cellID]) {
        
        _personLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _timeLabel = [UILabel addLableFont:14 WithColor:getColor(@"323232")];
        
        _lineView = [UIView addLineViewColor:getColor(@"F0F0F0")];
        
        _configBtn = [UIButton addBtnTitle:@"确认配送" AndTitleColor:getColor(@"4E4E4E") AndTitleFont:12 WithTarget:self action:@selector(configBtnClick)];
        
        _configBtn.layer.cornerRadius = 5.0f;
        _configBtn.layer.masksToBounds = YES;
        _configBtn.layer.borderWidth = 1.0f;
        _configBtn.layer.borderColor = getColor(@"4E4E4E").CGColor;
        
        [self sd_addSubviews:@[self.personLabel,self.lineView,self.timeLabel,self.configBtn]];
        
        [self layOutFrame];
    }
    
    return self;
}

- (void)layOutFrame{
    
    ws(self)
       
    [self.configBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(UNIT_WIDTH(-15));
        make.centerY.mas_equalTo(weakself.mas_centerY);
        make.width.mas_equalTo(UNIT_WIDTH(80));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
        
    }];
    
    [self.personLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.centerY.mas_equalTo(weakself.mas_centerY);
        
    }];
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(UNIT_WIDTH(-15));
        make.centerY.mas_equalTo(weakself.mas_centerY);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(5);
        
    }];
}


- (void)configBtnClick{
    
    if (_getConFigClick) {
        
        _getConFigClick(self);
    }
    
}

@end




